#!/usr/bin/python
# add stack datastructure
# "Lynn Lin <lynn.lin@avocent.com>"
class UnderFlowError(Exception):
	pass
class stack(object):
	def __init__(self):
		self.sta = []
	def __len__(self):
		return len(self.sta)
	def StackEmpty(self):
		return self.__len__()
	def push(self,value):
		self.sta.append(value)
	def pop(self):
		try:
			return self.sta.pop()
		except:
			raise UnderFlowError,"stack is empty ,no value to pop!"
